import React, { useEffect, useLayoutEffect, useState } from "react";

export default function UseLayoutEffectDemo() {
  const [string, setString] = useState("hello");
  useLayoutEffect(() => {
    let i = 0;
    while (i < 3000000000) {
      i++;
    }
    setString("world");
  }, []);

  return (
    <>
      <div>UseLayoutEffectDemo</div>
      <div>{string}</div>
    </>
  );
}
